package com.client;


import com.service.IHello;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

/**
 * Created by lyh on 2017/7/17.
 */
public class MyClient {

    public static void main(String[] args){
        try {
            IHello hello = (IHello) Naming.lookup("rmi://172.20.8.122:8888/RHello");
            System.out.println("method1-->sayHello()："+hello.sayHello());
            System.out.println("method2-->sayHelloToSomebody():"+hello.sayHelloToSomebody("李耀华"));
        } catch (NotBoundException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}
